Borland Online And The Cobb Group Present:


June, 1995 - Vol. 2 No. 6

Style sheets versus source pools

In the accompanying article, Borland C++ 4.0 IDE - Building release candidates from source pools we show how you can use source pools to apply various compiler or linker settings to a source file or executable target. On the surface, source pools and style sheets seem to perform similar functions: Source pools apply settings to subnodes, and style sheets apply settings to nodes that reference the style sheets.

However, there are several important distinctions between source pools and style sheets with regard to how you can use them in your projects. Here, we'll compare these two features of the Borland C++ Integrated Development Environment (IDE).

Style sheet mettle

A style sheet is a set of project options that you can apply, as a group, to any node. Any of the options that you can apply directly to a node, you can also apply by creating a style sheet, setting the option in the style sheet, and then assigning that style sheet to that node.

At first glance, it would appear that creating a style sheet for a set of options is more involved than simply setting those same options for each node directly. However, if you need to apply the same combination of options more than once, you'll probably want to create a style sheet for those options. You can assign a single style sheet to as many nodes as you like, as shown in Figure A.


Figure A - You can assign a single style sheet to any number of nodes in a project.

Node-to-node

A source pool is an element that you can add to the project window to contain other nodes. If you apply specific options to a source pool, those settings affect only the source pool and the nodes it contains. In fact, that's the reason Borland created source pools: to group nodes together that require common options.

Unfortunately, since a source pool is just a node container and isn't something that you can build or compile, there aren't very many project options that apply to a source pool. If you try to set the local options for a source pool node, you'll be able to modify only the following options: the directory paths, the command-line options for any tool that will process the source pool, pre-defined constants, and the node's build attributes (Build Always, Never Build, and so on).

Because you can't set compiler and linker options for a source pool node, most of the time you'll need to apply a style sheet to the source pool instead. The source pool will then apply the appropriate types of options to each type of subnode (for example, compiler options for CPP files or compiler/linker options for EXE targets). In contrast to style sheets (which don't specify relationships between nodes), source pools actually illustrate and set complex node-to-node relationships in your projects.

Return to the Borland C++ Developer's Journal index

Subscribe to the Borland C++ Developer's Journal


Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.